function matrix = confusion_matrix(y, pred, num_labels, m)
matrix = zeros(num_labels, num_labels);
for i = 1:m
matrix(y(i), pred(i)) = matrix(y(i), pred(i)) + 1;
endfor

end